<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Priithon.wxAsyncDispatcher</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Priithon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/priithon">Priithon</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="Priithon-module.html">Package&nbsp;Priithon</a> ::
        Module&nbsp;wxAsyncDispatcher
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="Priithon.wxAsyncDispatcher-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="Priithon.wxAsyncDispatcher-module.html">Module Priithon.wxAsyncDispatcher</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-docstring">""" Priithon</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-docstring"># modified version of http://wiki.wxpython.org/AsynchronousSockets </tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">#                     by Josiah Carlson</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring"># seb: what does this mean:</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">             # remember to validate any possible</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-docstring">             # socket objects recieved from the GUI,</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-docstring">             # they could already be closed</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-docstring">       # this is somehow related to the **kwarg sock=self - but otherwise unused</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">__future__</tt> <tt class="py-keyword">import</tt> <tt class="py-name">absolute_import</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">wx</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">lib</tt><tt class="py-op">.</tt><tt class="py-name">newevent</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">socket</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">asyncore</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">threading</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">Queue</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable Priithon.wxAsyncDispatcher.to_network=Priithon.wxAsyncDispatcher-module.html#to_network"><a title="Priithon.wxAsyncDispatcher.to_network" class="py-name" href="#" onclick="return doclink('link-0', 'to_network', 'link-0');">to_network</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Queue</tt><tt class="py-op">.</tt><tt class="py-name">Queue</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt id="link-1" class="py-name" targets="Method Priithon.wxAsyncDispatcher.MainWindow.LogEvent()=Priithon.wxAsyncDispatcher.MainWindow-class.html#LogEvent"><a title="Priithon.wxAsyncDispatcher.MainWindow.LogEvent" class="py-name" href="#" onclick="return doclink('link-1', 'LogEvent', 'link-1');">LogEvent</a></tt><tt class="py-op">,</tt> <tt id="link-2" class="py-name" targets="Variable Priithon.wxAsyncDispatcher.EVT_LOG_EVENT=Priithon.wxAsyncDispatcher-module.html#EVT_LOG_EVENT"><a title="Priithon.wxAsyncDispatcher.EVT_LOG_EVENT" class="py-name" href="#" onclick="return doclink('link-2', 'EVT_LOG_EVENT', 'link-2');">EVT_LOG_EVENT</a></tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">lib</tt><tt class="py-op">.</tt><tt class="py-name">newevent</tt><tt class="py-op">.</tt><tt class="py-name">NewEvent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-comment">#for high bandwidth applications, you are going to want to handle the</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#out_buffer via a different mechanism, perhaps similar to asynchat or</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#otherwise</tt> </tt>
<a name="DispatcherConnection"></a><div id="DispatcherConnection-def"><a name="L26"></a><tt class="py-lineno"> 26</tt> <a class="py-toggle" href="#" id="DispatcherConnection-toggle" onclick="return toggle('DispatcherConnection');">-</a><tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">class</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html">DispatcherConnection</a><tt class="py-op">(</tt><tt class="py-base-class">asyncore</tt><tt class="py-op">.</tt><tt class="py-base-class">dispatcher_with_send</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherConnection-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DispatcherConnection-expanded"><a name="DispatcherConnection.__init__"></a><div id="DispatcherConnection.__init__-def"><a name="L27"></a><tt class="py-lineno"> 27</tt> <a class="py-toggle" href="#" id="DispatcherConnection.__init__-toggle" onclick="return toggle('DispatcherConnection.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">connection</tt><tt class="py-op">,</tt> <tt class="py-param">logFcn</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment"># mainwindow):</tt> </tt>
</div><a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">        seb: logFcn, if None no logging done, otherwise logFcn called for each log-print</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">        <tt class="py-comment">#seb self.mainwindow = mainwindow</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt> <tt class="py-op">=</tt> <tt class="py-name">logFcn</tt> <tt class="py-comment"># seb</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">        <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt class="py-name">dispatcher_with_send</tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Method Priithon.DragAndDrop.ClipTextPanel.__init__()=Priithon.DragAndDrop.ClipTextPanel-class.html#__init__,Method Priithon.DragAndDrop.FileDropPanel.__init__()=Priithon.DragAndDrop.FileDropPanel-class.html#__init__,Method Priithon.DragAndDrop.MyFileDropTarget.__init__()=Priithon.DragAndDrop.MyFileDropTarget-class.html#__init__,Method Priithon.Mrc.Mrc.__init__()=Priithon.Mrc.Mrc-class.html#__init__,Method Priithon.Mrc.Mrc2.__init__()=Priithon.Mrc.Mrc2-class.html#__init__,Method Priithon.Scientific_IO_TextFile.TextFile.__init__()=Priithon.Scientific_IO_TextFile.TextFile-class.html#__init__,Method Priithon.buttonbox._buttonBox.__init__()=Priithon.buttonbox._buttonBox-class.html#__init__,Method Priithon.fileDropPopup.FileDropTarget.__init__()=Priithon.fileDropPopup.FileDropTarget-class.html#__init__,Method Priithon.gridviewer.ArrayGrid.__init__()=Priithon.gridviewer.ArrayGrid-class.html#__init__,Method Priithon.gridviewer.HugeTable.__init__()=Priithon.gridviewer.HugeTable-class.html#__init__,Method Priithon.gridviewer.HugeTableGrid.__init__()=Priithon.gridviewer.HugeTableGrid-class.html#__init__,Method Priithon.guiExceptionFrame.MyFrame.__init__()=Priithon.guiExceptionFrame.MyFrame-class.html#__init__,Method Priithon.guiInfoFrame.HtmlInfoFrame.__init__()=Priithon.guiInfoFrame.HtmlInfoFrame-class.html#__init__,Method Priithon.guiInfoFrame.HtmlWindow.__init__()=Priithon.guiInfoFrame.HtmlWindow-class.html#__init__,Method Priithon.guiParams.guiParams.__init__()=Priithon.guiParams.guiParams-class.html#__init__,Method Priithon.histogram.HistogramCanvas.__init__()=Priithon.histogram.HistogramCanvas-class.html#__init__,Method Priithon.histogram.MyCanvasBase.__init__()=Priithon.histogram.MyCanvasBase-class.html#__init__,Method Priithon.mmviewer.GLViewer.__init__()=Priithon.mmviewer.GLViewer-class.html#__init__,Method Priithon.mockNDarray.mockNDarray.__init__()=Priithon.mockNDarray.mockNDarray-class.html#__init__,Method Priithon.ndarray_meta.nd_meta_attribute.__init__()=Priithon.ndarray_meta.nd_meta_attribute-class.html#__init__,Method Priithon.plt.dumb_shelve.DbfilenameShelf.__init__()=Priithon.plt.dumb_shelve.DbfilenameShelf-class.html#__init__,Method Priithon.plt.dumbdbm_patched._Database.__init__()=Priithon.plt.dumbdbm_patched._Database-class.html#__init__,Method Priithon.plt.plot_objects.axis_object.__init__()=Priithon.plt.plot_objects.axis_object-class.html#__init__,Method Priithon.plt.plot_objects.axis_window.__init__()=Priithon.plt.plot_objects.axis_window-class.html#__init__,Method Priithon.plt.plot_objects.border_object.__init__()=Priithon.plt.plot_objects.border_object-class.html#__init__,Method Priithon.plt.plot_objects.graphic_list.__init__()=Priithon.plt.plot_objects.graphic_list-class.html#__init__,Method Priithon.plt.plot_objects.image_object.__init__()=Priithon.plt.plot_objects.image_object-class.html#__init__,Method Priithon.plt.plot_objects.legend_object.__init__()=Priithon.plt.plot_objects.legend_object-class.html#__init__,Method Priithon.plt.plot_objects.line_object.__init__()=Priithon.plt.plot_objects.line_object-class.html#__init__,Method Priithon.plt.plot_objects.poly_line.__init__()=Priithon.plt.plot_objects.poly_line-class.html#__init__,Method Priithon.plt.plot_objects.poly_marker.__init__()=Priithon.plt.plot_objects.poly_marker-class.html#__init__,Method Priithon.plt.plot_objects.poly_points.__init__()=Priithon.plt.plot_objects.poly_points-class.html#__init__,Method Priithon.plt.plot_objects.text_object.__init__()=Priithon.plt.plot_objects.text_object-class.html#__init__,Method Priithon.plt.plot_objects.text_window.__init__()=Priithon.plt.plot_objects.text_window-class.html#__init__,Method Priithon.plt.plot_utility.box_object.__init__()=Priithon.plt.plot_utility.box_object-class.html#__init__,Method Priithon.plt.plot_utility.point_object.__init__()=Priithon.plt.plot_utility.point_object-class.html#__init__,Method Priithon.plt.plot_utility.property_object.__init__()=Priithon.plt.plot_utility.property_object-class.html#__init__,Method Priithon.plt.wxplt.graph_printout.__init__()=Priithon.plt.wxplt.graph_printout-class.html#__init__,Method Priithon.plt.wxplt.plot_canvas.__init__()=Priithon.plt.wxplt.plot_canvas-class.html#__init__,Method Priithon.plt.wxplt.plot_frame.__init__()=Priithon.plt.wxplt.plot_frame-class.html#__init__,Method Priithon.py.PyAlaCarte.App.__init__()=Priithon.py.PyAlaCarte.App-class.html#__init__,Method Priithon.py.PyAlaMode.App.__init__()=Priithon.py.PyAlaMode.App-class.html#__init__,Method Priithon.py.PyAlaModeTest.App.__init__()=Priithon.py.PyAlaModeTest.App-class.html#__init__,Method Priithon.py.buffer.Buffer.__init__()=Priithon.py.buffer.Buffer-class.html#__init__,Method Priithon.py.crust.Calltip.__init__()=Priithon.py.crust.Calltip-class.html#__init__,Method Priithon.py.crust.Crust.__init__()=Priithon.py.crust.Crust-class.html#__init__,Method Priithon.py.crust.CrustFrame.__init__()=Priithon.py.crust.CrustFrame-class.html#__init__,Method Priithon.py.crust.DispatcherListing.__init__()=Priithon.py.crust.DispatcherListing-class.html#__init__,Method Priithon.py.crust.Display.__init__()=Priithon.py.crust.Display-class.html#__init__,Method Priithon.py.crust.SessionListing.__init__()=Priithon.py.crust.SessionListing-class.html#__init__,Method Priithon.py.dispatcher.BoundMethodWeakref.__init__()=Priithon.py.dispatcher.BoundMethodWeakref-class.html#__init__,Method Priithon.py.dispatcher.DispatcherError.__init__()=Priithon.py.dispatcher.DispatcherError-class.html#__init__,Method Priithon.py.document.Document.__init__()=Priithon.py.document.Document-class.html#__init__,Method Priithon.py.editor.DialogResults.__init__()=Priithon.py.editor.DialogResults-class.html#__init__,Method Priithon.py.editor.EditWindow.__init__()=Priithon.py.editor.EditWindow-class.html#__init__,Method Priithon.py.editor.Editor.__init__()=Priithon.py.editor.Editor-class.html#__init__,Method Priithon.py.editor.EditorFrame.__init__()=Priithon.py.editor.EditorFrame-class.html#__init__,Method Priithon.py.editor.EditorNotebook.__init__()=Priithon.py.editor.EditorNotebook-class.html#__init__,Method Priithon.py.editor.EditorNotebookFrame.__init__()=Priithon.py.editor.EditorNotebookFrame-class.html#__init__,Method Priithon.py.editor.EditorShellNotebook.__init__()=Priithon.py.editor.EditorShellNotebook-class.html#__init__,Method Priithon.py.editor.EditorShellNotebookFrame.__init__()=Priithon.py.editor.EditorShellNotebookFrame-class.html#__init__,Method Priithon.py.editwindow.EditWindow.__init__()=Priithon.py.editwindow.EditWindow-class.html#__init__,Method Priithon.py.filling.Filling.__init__()=Priithon.py.filling.Filling-class.html#__init__,Method Priithon.py.filling.FillingFrame.__init__()=Priithon.py.filling.FillingFrame-class.html#__init__,Method Priithon.py.filling.FillingText.__init__()=Priithon.py.filling.FillingText-class.html#__init__,Method Priithon.py.filling.FillingTree.__init__()=Priithon.py.filling.FillingTree-class.html#__init__,Method Priithon.py.frame.Frame.__init__()=Priithon.py.frame.Frame-class.html#__init__,Method Priithon.py.interpreter.Interpreter.__init__()=Priithon.py.interpreter.Interpreter-class.html#__init__,Method Priithon.py.interpreter.InterpreterAlaCarte.__init__()=Priithon.py.interpreter.InterpreterAlaCarte-class.html#__init__,Method Priithon.py.pseudo.PseudoFile.__init__()=Priithon.py.pseudo.PseudoFile-class.html#__init__,Method Priithon.py.pseudo.PseudoFileErr.__init__()=Priithon.py.pseudo.PseudoFileErr-class.html#__init__,Method Priithon.py.pseudo.PseudoFileIn.__init__()=Priithon.py.pseudo.PseudoFileIn-class.html#__init__,Method Priithon.py.pseudo.PseudoFileOut.__init__()=Priithon.py.pseudo.PseudoFileOut-class.html#__init__,Method Priithon.py.pseudo.PseudoKeyword.__init__()=Priithon.py.pseudo.PseudoKeyword-class.html#__init__,Method Priithon.py.shell.Shell.__init__()=Priithon.py.shell.Shell-class.html#__init__,Method Priithon.py.shell.ShellFacade.__init__()=Priithon.py.shell.ShellFacade-class.html#__init__,Method Priithon.py.shell.ShellFrame.__init__()=Priithon.py.shell.ShellFrame-class.html#__init__,Method Priithon.readerSPE.File.__init__()=Priithon.readerSPE.File-class.html#__init__,Method Priithon.scalePanel.scalePanel.__init__()=Priithon.scalePanel.scalePanel-class.html#__init__,Method Priithon.splitND.TestTransientPopup.__init__()=Priithon.splitND.TestTransientPopup-class.html#__init__,Method Priithon.splitND.spv.__init__()=Priithon.splitND.spv-class.html#__init__,Method Priithon.splitND2.spv.__init__()=Priithon.splitND2.spv-class.html#__init__,Method Priithon.splitNDcommon.spvCommon.__init__()=Priithon.splitNDcommon.spvCommon-class.html#__init__,Method Priithon.syncViewersGui.syncViewersGui.__init__()=Priithon.syncViewersGui.syncViewersGui-class.html#__init__,Method Priithon.useful.deco_memoized.__init__()=Priithon.useful.deco_memoized-class.html#__init__,Method Priithon.usefulX._listArrayViewer.__init__()=Priithon.usefulX._listArrayViewer-class.html#__init__,Method Priithon.usefulX._listFilesViewer.MyFileDropTarget.__init__()=Priithon.usefulX._listFilesViewer.MyFileDropTarget-class.html#__init__,Method Priithon.usefulX._listFilesViewer.__init__()=Priithon.usefulX._listFilesViewer-class.html#__init__,Method Priithon.viewer.GLViewer.__init__()=Priithon.viewer.GLViewer-class.html#__init__,Method Priithon.viewer2.GLViewer2.__init__()=Priithon.viewer2.GLViewer2-class.html#__init__,Method Priithon.viewerCommon.GLViewerCommon.__init__()=Priithon.viewerCommon.GLViewerCommon-class.html#__init__,Method Priithon.viewerRubberbandMode.viewerRubberbandMode.__init__()=Priithon.viewerRubberbandMode.viewerRubberbandMode-class.html#__init__,Method Priithon.wxAsyncDispatcher.DispatcherConnection.__init__()=Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#__init__,Method Priithon.wxAsyncDispatcher.DispatcherServer.__init__()=Priithon.wxAsyncDispatcher.DispatcherServer-class.html#__init__,Method Priithon.wxAsyncDispatcher.MainWindow.__init__()=Priithon.wxAsyncDispatcher.MainWindow-class.html#__init__,Method Priithon.wxPyPlot.FloatDCWrapper.__init__()=Priithon.wxPyPlot.FloatDCWrapper-class.html#__init__,Method Priithon.wxPyPlot.PlotCanvas.__init__()=Priithon.wxPyPlot.PlotCanvas-class.html#__init__,Method Priithon.wxPyPlot.PlotGraphics.__init__()=Priithon.wxPyPlot.PlotGraphics-class.html#__init__,Method Priithon.wxPyPlot.PolyLine.__init__()=Priithon.wxPyPlot.PolyLine-class.html#__init__,Method Priithon.wxPyPlot.PolyMarker.__init__()=Priithon.wxPyPlot.PolyMarker-class.html#__init__,Method Priithon.wxPyPlot.PolyPoints.__init__()=Priithon.wxPyPlot.PolyPoints-class.html#__init__,Method Priithon.wxPyPlot.plot_printout.__init__()=Priithon.wxPyPlot.plot_printout-class.html#__init__,Method Priithon.zslider.ZSlider.__init__()=Priithon.zslider.ZSlider-class.html#__init__"><a title="Priithon.DragAndDrop.ClipTextPanel.__init__
Priithon.DragAndDrop.FileDropPanel.__init__
Priithon.DragAndDrop.MyFileDropTarget.__init__
Priithon.Mrc.Mrc.__init__
Priithon.Mrc.Mrc2.__init__
Priithon.Scientific_IO_TextFile.TextFile.__init__
Priithon.buttonbox._buttonBox.__init__
Priithon.fileDropPopup.FileDropTarget.__init__
Priithon.gridviewer.ArrayGrid.__init__
Priithon.gridviewer.HugeTable.__init__
Priithon.gridviewer.HugeTableGrid.__init__
Priithon.guiExceptionFrame.MyFrame.__init__
Priithon.guiInfoFrame.HtmlInfoFrame.__init__
Priithon.guiInfoFrame.HtmlWindow.__init__
Priithon.guiParams.guiParams.__init__
Priithon.histogram.HistogramCanvas.__init__
Priithon.histogram.MyCanvasBase.__init__
Priithon.mmviewer.GLViewer.__init__
Priithon.mockNDarray.mockNDarray.__init__
Priithon.ndarray_meta.nd_meta_attribute.__init__
Priithon.plt.dumb_shelve.DbfilenameShelf.__init__
Priithon.plt.dumbdbm_patched._Database.__init__
Priithon.plt.plot_objects.axis_object.__init__
Priithon.plt.plot_objects.axis_window.__init__
Priithon.plt.plot_objects.border_object.__init__
Priithon.plt.plot_objects.graphic_list.__init__
Priithon.plt.plot_objects.image_object.__init__
Priithon.plt.plot_objects.legend_object.__init__
Priithon.plt.plot_objects.line_object.__init__
Priithon.plt.plot_objects.poly_line.__init__
Priithon.plt.plot_objects.poly_marker.__init__
Priithon.plt.plot_objects.poly_points.__init__
Priithon.plt.plot_objects.text_object.__init__
Priithon.plt.plot_objects.text_window.__init__
Priithon.plt.plot_utility.box_object.__init__
Priithon.plt.plot_utility.point_object.__init__
Priithon.plt.plot_utility.property_object.__init__
Priithon.plt.wxplt.graph_printout.__init__
Priithon.plt.wxplt.plot_canvas.__init__
Priithon.plt.wxplt.plot_frame.__init__
Priithon.py.PyAlaCarte.App.__init__
Priithon.py.PyAlaMode.App.__init__
Priithon.py.PyAlaModeTest.App.__init__
Priithon.py.buffer.Buffer.__init__
Priithon.py.crust.Calltip.__init__
Priithon.py.crust.Crust.__init__
Priithon.py.crust.CrustFrame.__init__
Priithon.py.crust.DispatcherListing.__init__
Priithon.py.crust.Display.__init__
Priithon.py.crust.SessionListing.__init__
Priithon.py.dispatcher.BoundMethodWeakref.__init__
Priithon.py.dispatcher.DispatcherError.__init__
Priithon.py.document.Document.__init__
Priithon.py.editor.DialogResults.__init__
Priithon.py.editor.EditWindow.__init__
Priithon.py.editor.Editor.__init__
Priithon.py.editor.EditorFrame.__init__
Priithon.py.editor.EditorNotebook.__init__
Priithon.py.editor.EditorNotebookFrame.__init__
Priithon.py.editor.EditorShellNotebook.__init__
Priithon.py.editor.EditorShellNotebookFrame.__init__
Priithon.py.editwindow.EditWindow.__init__
Priithon.py.filling.Filling.__init__
Priithon.py.filling.FillingFrame.__init__
Priithon.py.filling.FillingText.__init__
Priithon.py.filling.FillingTree.__init__
Priithon.py.frame.Frame.__init__
Priithon.py.interpreter.Interpreter.__init__
Priithon.py.interpreter.InterpreterAlaCarte.__init__
Priithon.py.pseudo.PseudoFile.__init__
Priithon.py.pseudo.PseudoFileErr.__init__
Priithon.py.pseudo.PseudoFileIn.__init__
Priithon.py.pseudo.PseudoFileOut.__init__
Priithon.py.pseudo.PseudoKeyword.__init__
Priithon.py.shell.Shell.__init__
Priithon.py.shell.ShellFacade.__init__
Priithon.py.shell.ShellFrame.__init__
Priithon.readerSPE.File.__init__
Priithon.scalePanel.scalePanel.__init__
Priithon.splitND.TestTransientPopup.__init__
Priithon.splitND.spv.__init__
Priithon.splitND2.spv.__init__
Priithon.splitNDcommon.spvCommon.__init__
Priithon.syncViewersGui.syncViewersGui.__init__
Priithon.useful.deco_memoized.__init__
Priithon.usefulX._listArrayViewer.__init__
Priithon.usefulX._listFilesViewer.MyFileDropTarget.__init__
Priithon.usefulX._listFilesViewer.__init__
Priithon.viewer.GLViewer.__init__
Priithon.viewer2.GLViewer2.__init__
Priithon.viewerCommon.GLViewerCommon.__init__
Priithon.viewerRubberbandMode.viewerRubberbandMode.__init__
Priithon.wxAsyncDispatcher.DispatcherConnection.__init__
Priithon.wxAsyncDispatcher.DispatcherServer.__init__
Priithon.wxAsyncDispatcher.MainWindow.__init__
Priithon.wxPyPlot.FloatDCWrapper.__init__
Priithon.wxPyPlot.PlotCanvas.__init__
Priithon.wxPyPlot.PlotGraphics.__init__
Priithon.wxPyPlot.PolyLine.__init__
Priithon.wxPyPlot.PolyMarker.__init__
Priithon.wxPyPlot.PolyPoints.__init__
Priithon.wxPyPlot.plot_printout.__init__
Priithon.zslider.ZSlider.__init__" class="py-name" href="#" onclick="return doclink('link-3', '__init__', 'link-3');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">connection</tt><tt class="py-op">)</tt> </tt>
</div><a name="DispatcherConnection.writable"></a><div id="DispatcherConnection.writable-def"><a name="L34"></a><tt class="py-lineno"> 34</tt> <a class="py-toggle" href="#" id="DispatcherConnection.writable-toggle" onclick="return toggle('DispatcherConnection.writable');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#writable">writable</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherConnection.writable-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherConnection.writable-expanded"><a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">out_buffer</tt><tt class="py-op">)</tt> </tt>
</div><a name="DispatcherConnection.handle_write"></a><div id="DispatcherConnection.handle_write-def"><a name="L36"></a><tt class="py-lineno"> 36</tt> <a class="py-toggle" href="#" id="DispatcherConnection.handle_write-toggle" onclick="return toggle('DispatcherConnection.handle_write');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#handle_write">handle_write</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherConnection.handle_write-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherConnection.handle_write-expanded"><a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">initiate_send</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="DispatcherConnection.log"></a><div id="DispatcherConnection.log-def"><a name="L38"></a><tt class="py-lineno"> 38</tt> <a class="py-toggle" href="#" id="DispatcherConnection.log-toggle" onclick="return toggle('DispatcherConnection.log');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#log">log</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherConnection.log-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherConnection.log-expanded"><a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-comment">#self.mainwindow.LogString(message, sock=self)</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt><tt class="py-op">(</tt><tt class="py-name">message</tt><tt class="py-op">)</tt> </tt>
</div><a name="DispatcherConnection.log_info"></a><div id="DispatcherConnection.log_info-def"><a name="L42"></a><tt class="py-lineno"> 42</tt> <a class="py-toggle" href="#" id="DispatcherConnection.log_info-toggle" onclick="return toggle('DispatcherConnection.log_info');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#log_info">log_info</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message</tt><tt class="py-op">,</tt> <tt class="py-param">type</tt><tt class="py-op">=</tt><tt class="py-string">'info'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherConnection.log_info-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherConnection.log_info-expanded"><a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">type</tt> <tt class="py-op">!=</tt> <tt class="py-string">'info'</tt><tt class="py-op">:</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Variable Priithon.mandel.log=Priithon.mandel-module.html#log,Variable Priithon.plt.interface.log=Priithon.plt.interface-module.html#log,Variable Priithon.plt.log=Priithon.plt-module.html#log,Variable Priithon.plt.plot_objects.log=Priithon.plt.plot_objects-module.html#log,Variable Priithon.plt.plot_utility.log=Priithon.plt.plot_utility-module.html#log,Variable Priithon.plt.wxplt.log=Priithon.plt.wxplt-module.html#log,Method Priithon.wxAsyncDispatcher.DispatcherConnection.log()=Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#log"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-4', 'log', 'link-4');">log</a></tt><tt class="py-op">(</tt><tt class="py-name">message</tt><tt class="py-op">)</tt> </tt>
</div><a name="DispatcherConnection.handle_close"></a><div id="DispatcherConnection.handle_close-def"><a name="L45"></a><tt class="py-lineno"> 45</tt> <a class="py-toggle" href="#" id="DispatcherConnection.handle_close-toggle" onclick="return toggle('DispatcherConnection.handle_close');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherConnection-class.html#handle_close">handle_close</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherConnection.handle_close-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherConnection.handle_close-expanded"><a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-5', 'log', 'link-4');">log</a></tt><tt class="py-op">(</tt><tt class="py-string">"Connection dropped: %s"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">addr</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method Priithon.Mrc.Mrc.close()=Priithon.Mrc.Mrc-class.html#close,Method Priithon.Mrc.Mrc2.close()=Priithon.Mrc.Mrc2-class.html#close,Method Priithon.Scientific_IO_TextFile.TextFile.close()=Priithon.Scientific_IO_TextFile.TextFile-class.html#close,Method Priithon.plt.dumbdbm_patched._Database.close()=Priithon.plt.dumbdbm_patched._Database-class.html#close,Function Priithon.plt.interface.close()=Priithon.plt.interface-module.html#close,Method Priithon.readerSPE.File.close()=Priithon.readerSPE.File-class.html#close"><a title="Priithon.Mrc.Mrc.close
Priithon.Mrc.Mrc2.close
Priithon.Scientific_IO_TextFile.TextFile.close
Priithon.plt.dumbdbm_patched._Database.close
Priithon.plt.interface.close
Priithon.readerSPE.File.close" class="py-name" href="#" onclick="return doclink('link-6', 'close', 'link-6');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">    <tt class="py-comment">#implement your client logic as a subclass</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="LineEchoConnection"></a><div id="LineEchoConnection-def"><a name="L51"></a><tt class="py-lineno"> 51</tt> <a class="py-toggle" href="#" id="LineEchoConnection-toggle" onclick="return toggle('LineEchoConnection');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.LineEchoConnection-class.html">LineEchoConnection</a><tt class="py-op">(</tt><tt class="py-base-class">DispatcherConnection</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LineEchoConnection-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="LineEchoConnection-expanded"><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">    <tt id="link-7" class="py-name" targets="Variable Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer=Priithon.wxAsyncDispatcher.LineEchoConnection-class.html#inc_buffer"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-7', 'inc_buffer', 'link-7');">inc_buffer</a></tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="LineEchoConnection.handle_read"></a><div id="LineEchoConnection.handle_read-def"><a name="L53"></a><tt class="py-lineno"> 53</tt> <a class="py-toggle" href="#" id="LineEchoConnection.handle_read-toggle" onclick="return toggle('LineEchoConnection.handle_read');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.LineEchoConnection-class.html#handle_read">handle_read</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LineEchoConnection.handle_read-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="LineEchoConnection.handle_read-expanded"><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-8', 'inc_buffer', 'link-7');">inc_buffer</a></tt> <tt class="py-op">+=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">recv</tt><tt class="py-op">(</tt><tt class="py-number">512</tt><tt class="py-op">)</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-string">'\n'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-9', 'inc_buffer', 'link-7');">inc_buffer</a></tt><tt class="py-op">:</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">            <tt class="py-name">snd</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-10', 'inc_buffer', 'link-7');">inc_buffer</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-11', 'inc_buffer', 'link-7');">inc_buffer</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">            <tt class="py-name">snd</tt> <tt class="py-op">+=</tt> <tt class="py-string">'\n'</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-12', 'log', 'link-4');">log</a></tt><tt class="py-op">(</tt><tt class="py-string">"Line from %s: %r"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">addr</tt><tt class="py-op">,</tt> <tt class="py-name">snd</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Function Priithon.py.dispatcher.send()=Priithon.py.dispatcher-module.html#send"><a title="Priithon.py.dispatcher.send" class="py-name" href="#" onclick="return doclink('link-13', 'send', 'link-13');">send</a></tt><tt class="py-op">(</tt><tt class="py-name">snd</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"> </tt>
<a name="DispatcherServer"></a><div id="DispatcherServer-def"><a name="L61"></a><tt class="py-lineno"> 61</tt> <a class="py-toggle" href="#" id="DispatcherServer-toggle" onclick="return toggle('DispatcherServer');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherServer-class.html">DispatcherServer</a><tt class="py-op">(</tt><tt class="py-base-class">asyncore</tt><tt class="py-op">.</tt><tt class="py-base-class">dispatcher</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherServer-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DispatcherServer-expanded"><a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">    <tt class="py-comment">#seb def __init__(self, host, port, mainwindow, factory=LineEchoConnection):</tt> </tt>
<a name="DispatcherServer.__init__"></a><div id="DispatcherServer.__init__-def"><a name="L63"></a><tt class="py-lineno"> 63</tt> <a class="py-toggle" href="#" id="DispatcherServer.__init__-toggle" onclick="return toggle('DispatcherServer.__init__');">-</a><tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherServer-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">host</tt><tt class="py-op">,</tt> <tt class="py-param">port</tt><tt class="py-op">,</tt> <tt class="py-param">factory</tt><tt class="py-op">,</tt> <tt class="py-param">logFcn</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherServer.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherServer.__init__-expanded"><a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">        seb: logFcn, if None no logging done, otherwise logFcn called for each log-print</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-comment">#seb self.mainwindow = mainwindow</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt> <tt class="py-op">=</tt> <tt class="py-name">logFcn</tt> <tt class="py-comment"># seb</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">factory</tt> <tt class="py-op">=</tt> <tt class="py-name">factory</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Module Priithon.py.dispatcher=Priithon.py.dispatcher-module.html"><a title="Priithon.py.dispatcher" class="py-name" href="#" onclick="return doclink('link-14', 'dispatcher', 'link-14');">dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="Priithon.DragAndDrop.ClipTextPanel.__init__
Priithon.DragAndDrop.FileDropPanel.__init__
Priithon.DragAndDrop.MyFileDropTarget.__init__
Priithon.Mrc.Mrc.__init__
Priithon.Mrc.Mrc2.__init__
Priithon.Scientific_IO_TextFile.TextFile.__init__
Priithon.buttonbox._buttonBox.__init__
Priithon.fileDropPopup.FileDropTarget.__init__
Priithon.gridviewer.ArrayGrid.__init__
Priithon.gridviewer.HugeTable.__init__
Priithon.gridviewer.HugeTableGrid.__init__
Priithon.guiExceptionFrame.MyFrame.__init__
Priithon.guiInfoFrame.HtmlInfoFrame.__init__
Priithon.guiInfoFrame.HtmlWindow.__init__
Priithon.guiParams.guiParams.__init__
Priithon.histogram.HistogramCanvas.__init__
Priithon.histogram.MyCanvasBase.__init__
Priithon.mmviewer.GLViewer.__init__
Priithon.mockNDarray.mockNDarray.__init__
Priithon.ndarray_meta.nd_meta_attribute.__init__
Priithon.plt.dumb_shelve.DbfilenameShelf.__init__
Priithon.plt.dumbdbm_patched._Database.__init__
Priithon.plt.plot_objects.axis_object.__init__
Priithon.plt.plot_objects.axis_window.__init__
Priithon.plt.plot_objects.border_object.__init__
Priithon.plt.plot_objects.graphic_list.__init__
Priithon.plt.plot_objects.image_object.__init__
Priithon.plt.plot_objects.legend_object.__init__
Priithon.plt.plot_objects.line_object.__init__
Priithon.plt.plot_objects.poly_line.__init__
Priithon.plt.plot_objects.poly_marker.__init__
Priithon.plt.plot_objects.poly_points.__init__
Priithon.plt.plot_objects.text_object.__init__
Priithon.plt.plot_objects.text_window.__init__
Priithon.plt.plot_utility.box_object.__init__
Priithon.plt.plot_utility.point_object.__init__
Priithon.plt.plot_utility.property_object.__init__
Priithon.plt.wxplt.graph_printout.__init__
Priithon.plt.wxplt.plot_canvas.__init__
Priithon.plt.wxplt.plot_frame.__init__
Priithon.py.PyAlaCarte.App.__init__
Priithon.py.PyAlaMode.App.__init__
Priithon.py.PyAlaModeTest.App.__init__
Priithon.py.buffer.Buffer.__init__
Priithon.py.crust.Calltip.__init__
Priithon.py.crust.Crust.__init__
Priithon.py.crust.CrustFrame.__init__
Priithon.py.crust.DispatcherListing.__init__
Priithon.py.crust.Display.__init__
Priithon.py.crust.SessionListing.__init__
Priithon.py.dispatcher.BoundMethodWeakref.__init__
Priithon.py.dispatcher.DispatcherError.__init__
Priithon.py.document.Document.__init__
Priithon.py.editor.DialogResults.__init__
Priithon.py.editor.EditWindow.__init__
Priithon.py.editor.Editor.__init__
Priithon.py.editor.EditorFrame.__init__
Priithon.py.editor.EditorNotebook.__init__
Priithon.py.editor.EditorNotebookFrame.__init__
Priithon.py.editor.EditorShellNotebook.__init__
Priithon.py.editor.EditorShellNotebookFrame.__init__
Priithon.py.editwindow.EditWindow.__init__
Priithon.py.filling.Filling.__init__
Priithon.py.filling.FillingFrame.__init__
Priithon.py.filling.FillingText.__init__
Priithon.py.filling.FillingTree.__init__
Priithon.py.frame.Frame.__init__
Priithon.py.interpreter.Interpreter.__init__
Priithon.py.interpreter.InterpreterAlaCarte.__init__
Priithon.py.pseudo.PseudoFile.__init__
Priithon.py.pseudo.PseudoFileErr.__init__
Priithon.py.pseudo.PseudoFileIn.__init__
Priithon.py.pseudo.PseudoFileOut.__init__
Priithon.py.pseudo.PseudoKeyword.__init__
Priithon.py.shell.Shell.__init__
Priithon.py.shell.ShellFacade.__init__
Priithon.py.shell.ShellFrame.__init__
Priithon.readerSPE.File.__init__
Priithon.scalePanel.scalePanel.__init__
Priithon.splitND.TestTransientPopup.__init__
Priithon.splitND.spv.__init__
Priithon.splitND2.spv.__init__
Priithon.splitNDcommon.spvCommon.__init__
Priithon.syncViewersGui.syncViewersGui.__init__
Priithon.useful.deco_memoized.__init__
Priithon.usefulX._listArrayViewer.__init__
Priithon.usefulX._listFilesViewer.MyFileDropTarget.__init__
Priithon.usefulX._listFilesViewer.__init__
Priithon.viewer.GLViewer.__init__
Priithon.viewer2.GLViewer2.__init__
Priithon.viewerCommon.GLViewerCommon.__init__
Priithon.viewerRubberbandMode.viewerRubberbandMode.__init__
Priithon.wxAsyncDispatcher.DispatcherConnection.__init__
Priithon.wxAsyncDispatcher.DispatcherServer.__init__
Priithon.wxAsyncDispatcher.MainWindow.__init__
Priithon.wxPyPlot.FloatDCWrapper.__init__
Priithon.wxPyPlot.PlotCanvas.__init__
Priithon.wxPyPlot.PlotGraphics.__init__
Priithon.wxPyPlot.PolyLine.__init__
Priithon.wxPyPlot.PolyMarker.__init__
Priithon.wxPyPlot.PolyPoints.__init__
Priithon.wxPyPlot.plot_printout.__init__
Priithon.zslider.ZSlider.__init__" class="py-name" href="#" onclick="return doclink('link-15', '__init__', 'link-3');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">create_socket</tt><tt class="py-op">(</tt><tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">AF_INET</tt><tt class="py-op">,</tt> <tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">SOCK_STREAM</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">bind</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">host</tt><tt class="py-op">,</tt> <tt class="py-name">port</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">listen</tt><tt class="py-op">(</tt><tt class="py-number">5</tt><tt class="py-op">)</tt> </tt>
</div><a name="DispatcherServer.handle_accept"></a><div id="DispatcherServer.handle_accept-def"><a name="L74"></a><tt class="py-lineno"> 74</tt> <a class="py-toggle" href="#" id="DispatcherServer.handle_accept-toggle" onclick="return toggle('DispatcherServer.handle_accept');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.DispatcherServer-class.html#handle_accept">handle_accept</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DispatcherServer.handle_accept-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DispatcherServer.handle_accept-expanded"><a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-name">connection</tt><tt class="py-op">,</tt> <tt id="link-16" class="py-name" targets="Method Priithon.Mrc.Mrc.info()=Priithon.Mrc.Mrc-class.html#info,Method Priithon.Mrc.Mrc2.info()=Priithon.Mrc.Mrc2-class.html#info"><a title="Priithon.Mrc.Mrc.info
Priithon.Mrc.Mrc2.info" class="py-name" href="#" onclick="return doclink('link-16', 'info', 'link-16');">info</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">accept</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-comment">#seb self.mainwindow.LogString("Got connection: %s"%(info,), sock=self)</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt><tt class="py-op">(</tt><tt class="py-string">"Got connection: %s"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt id="link-17" class="py-name"><a title="Priithon.Mrc.Mrc.info
Priithon.Mrc.Mrc2.info" class="py-name" href="#" onclick="return doclink('link-17', 'info', 'link-16');">info</a></tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-comment">#seb self.factory(connection, self.mainwindow)</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">factory</tt><tt class="py-op">(</tt><tt class="py-name">connection</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">logFcn</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"> </tt>
<a name="loop"></a><div id="loop-def"><a name="L82"></a><tt class="py-lineno"> 82</tt> <a class="py-toggle" href="#" id="loop-toggle" onclick="return toggle('loop');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher-module.html#loop">loop</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="loop-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="loop-expanded"><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">    <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-keyword">not</tt> <tt id="link-18" class="py-name"><a title="Priithon.wxAsyncDispatcher.to_network" class="py-name" href="#" onclick="return doclink('link-18', 'to_network', 'link-0');">to_network</a></tt><tt class="py-op">.</tt><tt class="py-name">empty</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">            <tt class="py-name">message</tt> <tt class="py-op">=</tt> <tt id="link-19" class="py-name"><a title="Priithon.wxAsyncDispatcher.to_network" class="py-name" href="#" onclick="return doclink('link-19', 'to_network', 'link-0');">to_network</a></tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">            <tt class="py-comment">#process and handle message</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#remember to validate any possible</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#socket objects recieved from the GUI,</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#they could already be closed</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt class="py-name">poll</tt><tt class="py-op">(</tt><tt class="py-name">timeout</tt><tt class="py-op">=</tt><tt class="py-number">.01</tt><tt class="py-op">)</tt> </tt>
</div><a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"> </tt>
<a name="MainWindow"></a><div id="MainWindow-def"><a name="L93"></a><tt class="py-lineno"> 93</tt> <a class="py-toggle" href="#" id="MainWindow-toggle" onclick="return toggle('MainWindow');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.MainWindow-class.html">MainWindow</a><tt class="py-op">(</tt><tt class="py-base-class">wx</tt><tt class="py-op">.</tt><tt class="py-base-class">Frame</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MainWindow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MainWindow-expanded"><a name="MainWindow.__init__"></a><div id="MainWindow.__init__-def"><a name="L94"></a><tt class="py-lineno"> 94</tt> <a class="py-toggle" href="#" id="MainWindow.__init__-toggle" onclick="return toggle('MainWindow.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.MainWindow-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">host</tt><tt class="py-op">,</tt> <tt class="py-param">port</tt><tt class="py-op">,</tt> <tt class="py-param">threaded</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MainWindow.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MainWindow.__init__-expanded"><a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Class Priithon.py.frame.Frame=Priithon.py.frame.Frame-class.html"><a title="Priithon.py.frame.Frame" class="py-name" href="#" onclick="return doclink('link-20', 'Frame', 'link-20');">Frame</a></tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="Priithon.DragAndDrop.ClipTextPanel.__init__
Priithon.DragAndDrop.FileDropPanel.__init__
Priithon.DragAndDrop.MyFileDropTarget.__init__
Priithon.Mrc.Mrc.__init__
Priithon.Mrc.Mrc2.__init__
Priithon.Scientific_IO_TextFile.TextFile.__init__
Priithon.buttonbox._buttonBox.__init__
Priithon.fileDropPopup.FileDropTarget.__init__
Priithon.gridviewer.ArrayGrid.__init__
Priithon.gridviewer.HugeTable.__init__
Priithon.gridviewer.HugeTableGrid.__init__
Priithon.guiExceptionFrame.MyFrame.__init__
Priithon.guiInfoFrame.HtmlInfoFrame.__init__
Priithon.guiInfoFrame.HtmlWindow.__init__
Priithon.guiParams.guiParams.__init__
Priithon.histogram.HistogramCanvas.__init__
Priithon.histogram.MyCanvasBase.__init__
Priithon.mmviewer.GLViewer.__init__
Priithon.mockNDarray.mockNDarray.__init__
Priithon.ndarray_meta.nd_meta_attribute.__init__
Priithon.plt.dumb_shelve.DbfilenameShelf.__init__
Priithon.plt.dumbdbm_patched._Database.__init__
Priithon.plt.plot_objects.axis_object.__init__
Priithon.plt.plot_objects.axis_window.__init__
Priithon.plt.plot_objects.border_object.__init__
Priithon.plt.plot_objects.graphic_list.__init__
Priithon.plt.plot_objects.image_object.__init__
Priithon.plt.plot_objects.legend_object.__init__
Priithon.plt.plot_objects.line_object.__init__
Priithon.plt.plot_objects.poly_line.__init__
Priithon.plt.plot_objects.poly_marker.__init__
Priithon.plt.plot_objects.poly_points.__init__
Priithon.plt.plot_objects.text_object.__init__
Priithon.plt.plot_objects.text_window.__init__
Priithon.plt.plot_utility.box_object.__init__
Priithon.plt.plot_utility.point_object.__init__
Priithon.plt.plot_utility.property_object.__init__
Priithon.plt.wxplt.graph_printout.__init__
Priithon.plt.wxplt.plot_canvas.__init__
Priithon.plt.wxplt.plot_frame.__init__
Priithon.py.PyAlaCarte.App.__init__
Priithon.py.PyAlaMode.App.__init__
Priithon.py.PyAlaModeTest.App.__init__
Priithon.py.buffer.Buffer.__init__
Priithon.py.crust.Calltip.__init__
Priithon.py.crust.Crust.__init__
Priithon.py.crust.CrustFrame.__init__
Priithon.py.crust.DispatcherListing.__init__
Priithon.py.crust.Display.__init__
Priithon.py.crust.SessionListing.__init__
Priithon.py.dispatcher.BoundMethodWeakref.__init__
Priithon.py.dispatcher.DispatcherError.__init__
Priithon.py.document.Document.__init__
Priithon.py.editor.DialogResults.__init__
Priithon.py.editor.EditWindow.__init__
Priithon.py.editor.Editor.__init__
Priithon.py.editor.EditorFrame.__init__
Priithon.py.editor.EditorNotebook.__init__
Priithon.py.editor.EditorNotebookFrame.__init__
Priithon.py.editor.EditorShellNotebook.__init__
Priithon.py.editor.EditorShellNotebookFrame.__init__
Priithon.py.editwindow.EditWindow.__init__
Priithon.py.filling.Filling.__init__
Priithon.py.filling.FillingFrame.__init__
Priithon.py.filling.FillingText.__init__
Priithon.py.filling.FillingTree.__init__
Priithon.py.frame.Frame.__init__
Priithon.py.interpreter.Interpreter.__init__
Priithon.py.interpreter.InterpreterAlaCarte.__init__
Priithon.py.pseudo.PseudoFile.__init__
Priithon.py.pseudo.PseudoFileErr.__init__
Priithon.py.pseudo.PseudoFileIn.__init__
Priithon.py.pseudo.PseudoFileOut.__init__
Priithon.py.pseudo.PseudoKeyword.__init__
Priithon.py.shell.Shell.__init__
Priithon.py.shell.ShellFacade.__init__
Priithon.py.shell.ShellFrame.__init__
Priithon.readerSPE.File.__init__
Priithon.scalePanel.scalePanel.__init__
Priithon.splitND.TestTransientPopup.__init__
Priithon.splitND.spv.__init__
Priithon.splitND2.spv.__init__
Priithon.splitNDcommon.spvCommon.__init__
Priithon.syncViewersGui.syncViewersGui.__init__
Priithon.useful.deco_memoized.__init__
Priithon.usefulX._listArrayViewer.__init__
Priithon.usefulX._listFilesViewer.MyFileDropTarget.__init__
Priithon.usefulX._listFilesViewer.__init__
Priithon.viewer.GLViewer.__init__
Priithon.viewer2.GLViewer2.__init__
Priithon.viewerCommon.GLViewerCommon.__init__
Priithon.viewerRubberbandMode.viewerRubberbandMode.__init__
Priithon.wxAsyncDispatcher.DispatcherConnection.__init__
Priithon.wxAsyncDispatcher.DispatcherServer.__init__
Priithon.wxAsyncDispatcher.MainWindow.__init__
Priithon.wxPyPlot.FloatDCWrapper.__init__
Priithon.wxPyPlot.PlotCanvas.__init__
Priithon.wxPyPlot.PlotGraphics.__init__
Priithon.wxPyPlot.PolyLine.__init__
Priithon.wxPyPlot.PolyMarker.__init__
Priithon.wxPyPlot.PolyPoints.__init__
Priithon.wxPyPlot.plot_printout.__init__
Priithon.zslider.ZSlider.__init__" class="py-name" href="#" onclick="return doclink('link-21', '__init__', 'link-3');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt id="link-22" class="py-name" targets="Function Priithon.plt.interface.title()=Priithon.plt.interface-module.html#title,Method Priithon.plt.wxplt.plot_frame.title()=Priithon.plt.wxplt.plot_frame-class.html#title"><a title="Priithon.plt.interface.title
Priithon.plt.wxplt.plot_frame.title" class="py-name" href="#" onclick="return doclink('link-22', 'title', 'link-22');">title</a></tt><tt class="py-op">=</tt><tt class="py-string">"Demo echo server on %s:%s"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">host</tt><tt class="py-op">,</tt><tt class="py-name">port</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-comment">#add any other GUI objects here</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-name">sz</tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">BoxSizer</tt><tt class="py-op">(</tt><tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">VERTICAL</tt><tt class="py-op">)</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-23', 'log', 'link-4');">log</a></tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">TextCtrl</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-name">style</tt><tt class="py-op">=</tt><tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">TE_MULTILINE</tt><tt class="py-op">|</tt><tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">TE_RICH2</tt><tt class="py-op">)</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-name">sz</tt><tt class="py-op">.</tt><tt class="py-name">Add</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-24', 'log', 'link-4');">log</a></tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">EXPAND</tt><tt class="py-op">|</tt><tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">ALL</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">Bind</tt><tt class="py-op">(</tt><tt id="link-25" class="py-name"><a title="Priithon.wxAsyncDispatcher.EVT_LOG_EVENT" class="py-name" href="#" onclick="return doclink('link-25', 'EVT_LOG_EVENT', 'link-2');">EVT_LOG_EVENT</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="Priithon.wxAsyncDispatcher.MainWindow.LogEvent" class="py-name" href="#" onclick="return doclink('link-26', 'LogEvent', 'link-1');">LogEvent</a></tt><tt class="py-op">)</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt id="link-27" class="py-name" targets="Class Priithon.wxAsyncDispatcher.DispatcherServer=Priithon.wxAsyncDispatcher.DispatcherServer-class.html"><a title="Priithon.wxAsyncDispatcher.DispatcherServer" class="py-name" href="#" onclick="return doclink('link-27', 'DispatcherServer', 'link-27');">DispatcherServer</a></tt><tt class="py-op">(</tt><tt class="py-name">host</tt><tt class="py-op">,</tt> <tt class="py-name">port</tt><tt class="py-op">,</tt> <tt id="link-28" class="py-name" targets="Class Priithon.wxAsyncDispatcher.LineEchoConnection=Priithon.wxAsyncDispatcher.LineEchoConnection-class.html"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection" class="py-name" href="#" onclick="return doclink('link-28', 'LineEchoConnection', 'link-28');">LineEchoConnection</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Method Priithon.wxAsyncDispatcher.MainWindow.LogString()=Priithon.wxAsyncDispatcher.MainWindow-class.html#LogString"><a title="Priithon.wxAsyncDispatcher.MainWindow.LogString" class="py-name" href="#" onclick="return doclink('link-29', 'LogString', 'link-29');">LogString</a></tt><tt class="py-op">)</tt> <tt class="py-comment">#seb self)</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">threaded</tt><tt class="py-op">:</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">poller</tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">Timer</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">NewId</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">Bind</tt><tt class="py-op">(</tt><tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">EVT_TIMER</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Method Priithon.wxAsyncDispatcher.MainWindow.OnPoll()=Priithon.wxAsyncDispatcher.MainWindow-class.html#OnPoll"><a title="Priithon.wxAsyncDispatcher.MainWindow.OnPoll" class="py-name" href="#" onclick="return doclink('link-30', 'OnPoll', 'link-30');">OnPoll</a></tt><tt class="py-op">)</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">            <tt class="py-comment">#poll 50 times/second, should be enough for low-bandwidth apps</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">poller</tt><tt class="py-op">.</tt><tt class="py-name">Start</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">,</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">TIMER_CONTINUOUS</tt><tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-name">t</tt> <tt class="py-op">=</tt> <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">Thread</tt><tt class="py-op">(</tt><tt class="py-name">target</tt><tt class="py-op">=</tt><tt id="link-31" class="py-name" targets="Function Priithon.plt.wxplt.loop()=Priithon.plt.wxplt-module.html#loop,Function Priithon.wxAsyncDispatcher.loop()=Priithon.wxAsyncDispatcher-module.html#loop"><a title="Priithon.plt.wxplt.loop
Priithon.wxAsyncDispatcher.loop" class="py-name" href="#" onclick="return doclink('link-31', 'loop', 'link-31');">loop</a></tt><tt class="py-op">)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">            <tt class="py-name">t</tt><tt class="py-op">.</tt><tt class="py-name">setDaemon</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">            <tt class="py-name">t</tt><tt class="py-op">.</tt><tt class="py-name">start</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"> </tt>
<a name="MainWindow.LogString"></a><div id="MainWindow.LogString-def"><a name="L115"></a><tt class="py-lineno">115</tt> <a class="py-toggle" href="#" id="MainWindow.LogString-toggle" onclick="return toggle('MainWindow.LogString');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.MainWindow-class.html#LogString">LogString</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MainWindow.LogString-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MainWindow.LogString-expanded"><a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-name">event</tt> <tt class="py-op">=</tt> <tt id="link-32" class="py-name"><a title="Priithon.wxAsyncDispatcher.MainWindow.LogEvent" class="py-name" href="#" onclick="return doclink('link-32', 'LogEvent', 'link-1');">LogEvent</a></tt><tt class="py-op">(</tt><tt id="link-33" class="py-name" targets="Variable Priithon.wxPyPlot.msg=Priithon.wxPyPlot-module.html#msg"><a title="Priithon.wxPyPlot.msg" class="py-name" href="#" onclick="return doclink('link-33', 'msg', 'link-33');">msg</a></tt><tt class="py-op">=</tt><tt class="py-name">message</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">kwargs</tt><tt class="py-op">)</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">activeCount</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name"><a title="Priithon.wxAsyncDispatcher.MainWindow.LogEvent" class="py-name" href="#" onclick="return doclink('link-34', 'LogEvent', 'link-1');">LogEvent</a></tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">            <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">PostEvent</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
</div><a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"> </tt>
<a name="MainWindow.LogEvent"></a><div id="MainWindow.LogEvent-def"><a name="L122"></a><tt class="py-lineno">122</tt> <a class="py-toggle" href="#" id="MainWindow.LogEvent-toggle" onclick="return toggle('MainWindow.LogEvent');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.MainWindow-class.html#LogEvent">LogEvent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">evt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MainWindow.LogEvent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MainWindow.LogEvent-expanded"><a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-35', 'log', 'link-4');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">AppendText</tt><tt class="py-op">(</tt><tt class="py-name">evt</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="Priithon.wxPyPlot.msg" class="py-name" href="#" onclick="return doclink('link-36', 'msg', 'link-33');">msg</a></tt><tt class="py-op">)</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">evt</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="Priithon.wxPyPlot.msg" class="py-name" href="#" onclick="return doclink('link-37', 'msg', 'link-33');">msg</a></tt><tt class="py-op">.</tt><tt class="py-name">endswith</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="Priithon.mandel.log
Priithon.plt.interface.log
Priithon.plt.log
Priithon.plt.plot_objects.log
Priithon.plt.plot_utility.log
Priithon.plt.wxplt.log
Priithon.wxAsyncDispatcher.DispatcherConnection.log" class="py-name" href="#" onclick="return doclink('link-38', 'log', 'link-4');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">AppendText</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
</div><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"> </tt>
<a name="MainWindow.OnPoll"></a><div id="MainWindow.OnPoll-def"><a name="L127"></a><tt class="py-lineno">127</tt> <a class="py-toggle" href="#" id="MainWindow.OnPoll-toggle" onclick="return toggle('MainWindow.OnPoll');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher.MainWindow-class.html#OnPoll">OnPoll</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">evt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MainWindow.OnPoll-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MainWindow.OnPoll-expanded"><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt class="py-name">poll</tt><tt class="py-op">(</tt><tt class="py-name">timeout</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">    <tt class="py-comment">#add other methods as necessary</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">    <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name" targets="Class Priithon.py.PyAlaCarte.App=Priithon.py.PyAlaCarte.App-class.html,Class Priithon.py.PyAlaMode.App=Priithon.py.PyAlaMode.App-class.html,Class Priithon.py.PyAlaModeTest.App=Priithon.py.PyAlaModeTest.App-class.html,Class Priithon.py.PyCrust.App=Priithon.py.PyCrust.App-class.html,Class Priithon.py.PyFilling.App=Priithon.py.PyFilling.App-class.html,Class Priithon.py.PyShell.App=Priithon.py.PyShell.App-class.html,Class Priithon.py.filling.App=Priithon.py.filling.App-class.html"><a title="Priithon.py.PyAlaCarte.App
Priithon.py.PyAlaMode.App
Priithon.py.PyAlaModeTest.App
Priithon.py.PyCrust.App
Priithon.py.PyFilling.App
Priithon.py.PyShell.App
Priithon.py.filling.App" class="py-name" href="#" onclick="return doclink('link-39', 'App', 'link-39');">App</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">    <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-40" class="py-name" targets="Class Priithon.wxAsyncDispatcher.MainWindow=Priithon.wxAsyncDispatcher.MainWindow-class.html"><a title="Priithon.wxAsyncDispatcher.MainWindow" class="py-name" href="#" onclick="return doclink('link-40', 'MainWindow', 'link-40');">MainWindow</a></tt><tt class="py-op">(</tt><tt class="py-string">'localhost'</tt><tt class="py-op">,</tt> <tt class="py-number">3399</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">    <tt class="py-name">b</tt><tt class="py-op">.</tt><tt class="py-name">Show</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">    <tt class="py-name">a</tt><tt class="py-op">.</tt><tt class="py-name">MainLoop</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-comment">######################################################################</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># for Priithon</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">    <tt id="link-41" class="py-name" targets="Variable Priithon.wxAsyncDispatcher._pollers=Priithon.wxAsyncDispatcher-module.html#_pollers"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-41', '_pollers', 'link-41');">_pollers</a></tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line"><tt class="py-keyword">except</tt> <tt class="py-name">NameError</tt><tt class="py-op">:</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">    <tt id="link-42" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-42', '_pollers', 'link-41');">_pollers</a></tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line"> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"><tt class="py-string">'''</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line"><tt class="py-string">class CustomConnection(DispatcherConnection):</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line"><tt class="py-string">    #inc_buffer = ''</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line"><tt class="py-string"></tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-string">    # def __init__(self, connection, logFcn, handle_read):</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-string">    #     self.hr = handle_read</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-string">    #     DispatcherConnection.__init__(self, connection, logFcn)</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-string">    def handle_read(self):</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-string">        self.hr(self)</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-string">        # self.inc_buffer += self.recv(512)</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"><tt class="py-string">        # while '\n' in self.inc_buffer:</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"><tt class="py-string">        #     snd, self.inc_buffer = self.inc_buffer.split('\n', 1)</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"><tt class="py-string">        #     snd += '\n'</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"><tt class="py-string">        #     self.log("Line from %s: %r"%(self.addr, snd))</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line"><tt class="py-string">        #     self.send(snd)</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line"><tt class="py-string">'''</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="socketServerStart"></a><div id="socketServerStart-def"><a name="L162"></a><tt class="py-lineno">162</tt> <a class="py-toggle" href="#" id="socketServerStart-toggle" onclick="return toggle('socketServerStart');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher-module.html#socketServerStart">socketServerStart</a><tt class="py-op">(</tt><tt class="py-param">onRead</tt><tt class="py-op">,</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">                      <tt class="py-param">linewise</tt><tt class="py-op">=</tt><tt id="link-43" class="py-name" targets="Variable Priithon.wxPyPlot.True=Priithon.wxPyPlot-module.html#True"><a title="Priithon.wxPyPlot.True" class="py-name" href="#" onclick="return doclink('link-43', 'True', 'link-43');">True</a></tt><tt class="py-op">,</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">                      <tt class="py-param">logFcn</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">                      <tt class="py-param">port</tt><tt class="py-op">=</tt><tt class="py-number">4711</tt><tt class="py-op">,</tt>  </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">                      <tt class="py-param">host</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">,</tt>  </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">                      <tt class="py-param">wxEvtFrame</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt>  </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">                      <tt class="py-param">threaded</tt><tt class="py-op">=</tt><tt id="link-44" class="py-name" targets="Variable Priithon.wxPyPlot.False=Priithon.wxPyPlot-module.html#False"><a title="Priithon.wxPyPlot.False" class="py-name" href="#" onclick="return doclink('link-44', 'False', 'link-44');">False</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socketServerStart-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="socketServerStart-expanded"><a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">                      <tt class="py-comment">#20100301 arg not used: verbose=True):</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-docstring">"""</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"><tt class="py-docstring">    install a server to listen on given `port` on given `host`</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-docstring">    onRead is a handler function that is being called with a </tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"><tt class="py-docstring">    asyncore.dispatcher_with_send object as argument (`asynDisp`)</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line"><tt class="py-docstring">    (its type is really a DispatcherConnection, which is derived of that)</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-docstring">    if `linewise`: `onRead` is called for each completed line</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line"><tt class="py-docstring">                   an `line` is an extra first(!) argument</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line"><tt class="py-docstring">                   ('\n' is truncated)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line"><tt class="py-docstring">                   (`asynDisp.recv(512)` is called for you as needed!)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-docstring">    otherwise, `onRead` has to do the `asynDisp`.recv(512) calls itself</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line"><tt class="py-docstring">    `host`='' means "all IPs of local host" (127.0.0.1 + external IP(s))</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line"><tt class="py-docstring">    `logFcn`: if None no logging done, otherwise `logFcn` called for each </tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line"><tt class="py-docstring">                                log-print with string message as argument</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line"><tt class="py-docstring">    if `threaded` is False,</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line"><tt class="py-docstring">       a timer event is connected to `wxEvtFrame`</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line"><tt class="py-docstring">    `wxEvtFrame` None means, find and use "first" toplevel parent</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">threaded</tt><tt class="py-op">:</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">wxEvtFrame</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">            <tt class="py-name">wxEvtFrame</tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">GetTopLevelWindows</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line"> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">    <tt class="py-name">handlerFunc_dict</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">     </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">linewise</tt><tt class="py-op">:</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">        <tt class="py-comment">#'''</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-45" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-45', 'inc_buffer', 'link-7');">inc_buffer</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">''</tt><tt class="py-op">]</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">onRead_helper</tt><tt class="py-op">(</tt><tt class="py-param">asynDisp</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">            <tt id="link-46" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-46', 'inc_buffer', 'link-7');">inc_buffer</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">asynDisp</tt><tt class="py-op">.</tt><tt class="py-name">recv</tt><tt class="py-op">(</tt><tt class="py-number">512</tt><tt class="py-op">)</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">            <tt class="py-keyword">while</tt> <tt class="py-string">'\n'</tt> <tt class="py-keyword">in</tt> <tt id="link-47" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-47', 'inc_buffer', 'link-7');">inc_buffer</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">                <tt class="py-name">line</tt><tt class="py-op">,</tt> <tt id="link-48" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-48', 'inc_buffer', 'link-7');">inc_buffer</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-49" class="py-name"><a title="Priithon.wxAsyncDispatcher.LineEchoConnection.inc_buffer" class="py-name" href="#" onclick="return doclink('link-49', 'inc_buffer', 'link-7');">inc_buffer</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">                <tt class="py-comment">#line += '\n'</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-comment">#asynDisp.log("Line from %s: %r"%(asynDisp.addr, line))</tt> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-comment">#asynDisp.send(line)</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">                    <tt class="py-name">onRead</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">,</tt> <tt class="py-name">asynDisp</tt><tt class="py-op">)</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">                <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">                    <tt class="py-keyword">from</tt> <tt class="py-op">.</tt> <tt class="py-keyword">import</tt> <tt id="link-50" class="py-name" targets="Module Priithon.PriConfig=Priithon.PriConfig-module.html"><a title="Priithon.PriConfig" class="py-name" href="#" onclick="return doclink('link-50', 'PriConfig', 'link-50');">PriConfig</a></tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt id="link-51" class="py-name"><a title="Priithon.PriConfig" class="py-name" href="#" onclick="return doclink('link-51', 'PriConfig', 'link-50');">PriConfig</a></tt><tt class="py-op">.</tt><tt id="link-52" class="py-name" targets="Variable Priithon.PriConfig.raiseEventHandlerExceptions=Priithon.PriConfig-module.html#raiseEventHandlerExceptions"><a title="Priithon.PriConfig.raiseEventHandlerExceptions" class="py-name" href="#" onclick="return doclink('link-52', 'raiseEventHandlerExceptions', 'link-52');">raiseEventHandlerExceptions</a></tt><tt class="py-op">:</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">                        <tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">                        <tt class="py-keyword">from</tt> <tt class="py-op">.</tt><tt id="link-53" class="py-name" targets="Module Priithon.usefulX=Priithon.usefulX-module.html"><a title="Priithon.usefulX" class="py-name" href="#" onclick="return doclink('link-53', 'usefulX', 'link-53');">usefulX</a></tt> <tt class="py-keyword">import</tt> <tt id="link-54" class="py-name" targets="Function Priithon.usefulX._guiExcept()=Priithon.usefulX-module.html#_guiExcept"><a title="Priithon.usefulX._guiExcept" class="py-name" href="#" onclick="return doclink('link-54', '_guiExcept', 'link-54');">_guiExcept</a></tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">                        <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">CallAfter</tt><tt class="py-op">(</tt><tt id="link-55" class="py-name"><a title="Priithon.usefulX._guiExcept" class="py-name" href="#" onclick="return doclink('link-55', '_guiExcept', 'link-54');">_guiExcept</a></tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">exc_info</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">                    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">                        <tt class="py-keyword">import</tt> <tt class="py-name">traceback</tt><tt class="py-op">,</tt> <tt class="py-name">sys</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">                        <tt class="py-keyword">print</tt> <tt class="py-op">&gt;&gt;</tt><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">stderr</tt><tt class="py-op">,</tt> <tt class="py-string">" *** error in async onRead **"</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">                        <tt class="py-name">traceback</tt><tt class="py-op">.</tt><tt class="py-name">print_exc</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">                        <tt class="py-keyword">print</tt> <tt class="py-op">&gt;&gt;</tt><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">stderr</tt><tt class="py-op">,</tt> <tt class="py-string">" *** error in async onRead **"</tt> </tt>
</div><a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line"> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">        <tt class="py-comment">#'''</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-string">'''</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line"><tt class="py-string">        class onRead_helper_cls:</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line"><tt class="py-string">            def __init__(s):</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line"><tt class="py-string">                s.inc_buffer = ''</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line"><tt class="py-string"></tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line"><tt class="py-string">            #@staticmethod</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line"><tt class="py-string">            def __call__(s): # asynDisp):</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line"><tt class="py-string">                print s</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line"><tt class="py-string">                s.inc_buffer += asynDisp.recv(512)</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line"><tt class="py-string">                while '\n' in inc_buffer:</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line"><tt class="py-string">                    line, s.inc_buffer = s.inc_buffer.split('\n', 1)</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"><tt class="py-string">                    #line += '\n'</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-string">                    #asynDisp.log("Line from %s: %r"%(self.addr, line))</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line"><tt class="py-string">                    #asynDisp.send(line)</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line"><tt class="py-string">                    onRead(line, asynDisp)</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line"><tt class="py-string">        '''</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line"> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">        <tt class="py-name">handlerFunc_dict</tt><tt class="py-op">[</tt><tt class="py-string">"handle_read"</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">onRead_helper</tt> <tt class="py-comment"># onRead_helper_cls()</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">        <tt class="py-name">handlerFunc_dict</tt><tt class="py-op">[</tt><tt class="py-string">"handle_read"</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">onRead</tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line"> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt id="link-56" class="py-name" targets="Method Priithon.py.buffer.Buffer.new()=Priithon.py.buffer.Buffer-class.html#new"><a title="Priithon.py.buffer.Buffer.new" class="py-name" href="#" onclick="return doclink('link-56', 'new', 'link-56');">new</a></tt> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">    <tt class="py-name">factory</tt> <tt class="py-op">=</tt> <tt id="link-57" class="py-name"><a title="Priithon.py.buffer.Buffer.new" class="py-name" href="#" onclick="return doclink('link-57', 'new', 'link-56');">new</a></tt><tt class="py-op">.</tt><tt class="py-name">classobj</tt><tt class="py-op">(</tt><tt class="py-string">"Custom_DispatcherConnection"</tt><tt class="py-op">,</tt>  </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">                           <tt class="py-op">(</tt><tt id="link-58" class="py-name" targets="Class Priithon.wxAsyncDispatcher.DispatcherConnection=Priithon.wxAsyncDispatcher.DispatcherConnection-class.html"><a title="Priithon.wxAsyncDispatcher.DispatcherConnection" class="py-name" href="#" onclick="return doclink('link-58', 'DispatcherConnection', 'link-58');">DispatcherConnection</a></tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">                           <tt class="py-name">handlerFunc_dict</tt><tt class="py-op">)</tt> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">    <tt id="link-59" class="py-name"><a title="Priithon.wxAsyncDispatcher.DispatcherServer" class="py-name" href="#" onclick="return doclink('link-59', 'DispatcherServer', 'link-27');">DispatcherServer</a></tt><tt class="py-op">(</tt><tt class="py-name">host</tt><tt class="py-op">,</tt> <tt class="py-name">port</tt><tt class="py-op">,</tt> <tt class="py-name">factory</tt><tt class="py-op">,</tt> <tt class="py-name">logFcn</tt><tt class="py-op">)</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line"> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">threaded</tt><tt class="py-op">:</tt> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line"> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">OnPoll</tt><tt class="py-op">(</tt><tt class="py-param">evt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">            <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt class="py-name">poll</tt><tt class="py-op">(</tt><tt class="py-name">timeout</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line"> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line">        <tt class="py-name">poller</tt> <tt class="py-op">=</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">Timer</tt><tt class="py-op">(</tt><tt class="py-name">wxEvtFrame</tt><tt class="py-op">,</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">NewId</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line">        <tt class="py-name">wxEvtFrame</tt><tt class="py-op">.</tt><tt class="py-name">Bind</tt><tt class="py-op">(</tt><tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">EVT_TIMER</tt><tt class="py-op">,</tt> <tt id="link-60" class="py-name"><a title="Priithon.wxAsyncDispatcher.MainWindow.OnPoll" class="py-name" href="#" onclick="return doclink('link-60', 'OnPoll', 'link-30');">OnPoll</a></tt><tt class="py-op">)</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line">        <tt class="py-comment">#poll 50 times/second, should be enough for low-bandwidth apps</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">poller</tt><tt class="py-op">.</tt><tt class="py-name">Start</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">,</tt> <tt class="py-name">wx</tt><tt class="py-op">.</tt><tt class="py-name">TIMER_CONTINUOUS</tt><tt class="py-op">)</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line">        <tt class="py-name">poller</tt><tt class="py-op">.</tt><tt class="py-name">_id_in_pollers_list</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-61" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-61', '_pollers', 'link-41');">_pollers</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># so that it can be set to None later</tt> </tt>
<a name="L260"></a><tt class="py-lineno">260</tt>  <tt class="py-line">        <tt id="link-62" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-62', '_pollers', 'link-41');">_pollers</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-name">poller</tt> <tt class="py-op">)</tt> </tt>
<a name="L261"></a><tt class="py-lineno">261</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line">        <tt class="py-name">t</tt> <tt class="py-op">=</tt> <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">Thread</tt><tt class="py-op">(</tt><tt class="py-name">target</tt><tt class="py-op">=</tt><tt id="link-63" class="py-name"><a title="Priithon.plt.wxplt.loop
Priithon.wxAsyncDispatcher.loop" class="py-name" href="#" onclick="return doclink('link-63', 'loop', 'link-31');">loop</a></tt><tt class="py-op">)</tt> </tt>
<a name="L263"></a><tt class="py-lineno">263</tt>  <tt class="py-line">        <tt class="py-name">t</tt><tt class="py-op">.</tt><tt class="py-name">setDaemon</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line">        <tt class="py-name">t</tt><tt class="py-op">.</tt><tt class="py-name">start</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L265"></a><tt class="py-lineno">265</tt>  <tt class="py-line">        <tt class="py-name">t</tt><tt class="py-op">.</tt><tt class="py-name">_id_in_pollers_list</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-64" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-64', '_pollers', 'link-41');">_pollers</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># so that it can be set to None later</tt> </tt>
<a name="L266"></a><tt class="py-lineno">266</tt>  <tt class="py-line">        <tt id="link-65" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-65', '_pollers', 'link-41');">_pollers</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-name">t</tt> <tt class="py-op">)</tt>  <tt class="py-comment"># check type - HACK not really a poller but a thread</tt> </tt>
</div><a name="L267"></a><tt class="py-lineno">267</tt>  <tt class="py-line"> </tt>
<a name="L268"></a><tt class="py-lineno">268</tt>  <tt class="py-line"> </tt>
<a name="socketServer_demo"></a><div id="socketServer_demo-def"><a name="L269"></a><tt class="py-lineno">269</tt> <a class="py-toggle" href="#" id="socketServer_demo-toggle" onclick="return toggle('socketServer_demo');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher-module.html#socketServer_demo">socketServer_demo</a><tt class="py-op">(</tt><tt class="py-param">port</tt><tt class="py-op">=</tt><tt class="py-number">4711</tt><tt class="py-op">,</tt> <tt class="py-param">host</tt><tt class="py-op">=</tt><tt class="py-string">'localhost'</tt><tt class="py-op">,</tt> <tt class="py-param">threaded</tt><tt class="py-op">=</tt><tt id="link-66" class="py-name"><a title="Priithon.wxPyPlot.False" class="py-name" href="#" onclick="return doclink('link-66', 'False', 'link-44');">False</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socketServer_demo-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="socketServer_demo-expanded"><a name="L270"></a><tt class="py-lineno">270</tt>  <tt class="py-line">    <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-67" class="py-name"><a title="Priithon.wxAsyncDispatcher.MainWindow" class="py-name" href="#" onclick="return doclink('link-67', 'MainWindow', 'link-40');">MainWindow</a></tt><tt class="py-op">(</tt><tt class="py-name">host</tt><tt class="py-op">,</tt> <tt class="py-name">port</tt><tt class="py-op">,</tt> <tt class="py-name">threaded</tt><tt class="py-op">)</tt> </tt>
<a name="L271"></a><tt class="py-lineno">271</tt>  <tt class="py-line">    <tt class="py-name">b</tt><tt class="py-op">.</tt><tt class="py-name">Show</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
</div><a name="L272"></a><tt class="py-lineno">272</tt>  <tt class="py-line"> </tt>
<a name="socketServer_clearAll"></a><div id="socketServer_clearAll-def"><a name="L273"></a><tt class="py-lineno">273</tt> <a class="py-toggle" href="#" id="socketServer_clearAll-toggle" onclick="return toggle('socketServer_clearAll');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.wxAsyncDispatcher-module.html#socketServer_clearAll">socketServer_clearAll</a><tt class="py-op">(</tt><tt class="py-param">closeAllSockets</tt><tt class="py-op">=</tt><tt id="link-68" class="py-name"><a title="Priithon.wxPyPlot.True" class="py-name" href="#" onclick="return doclink('link-68', 'True', 'link-43');">True</a></tt><tt class="py-op">,</tt> <tt class="py-param">stopAllPolling</tt><tt class="py-op">=</tt><tt id="link-69" class="py-name"><a title="Priithon.wxPyPlot.True" class="py-name" href="#" onclick="return doclink('link-69', 'True', 'link-43');">True</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socketServer_clearAll-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="socketServer_clearAll-expanded"><a name="L274"></a><tt class="py-lineno">274</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L275"></a><tt class="py-lineno">275</tt>  <tt class="py-line"><tt class="py-docstring">    use this to stop all prior started servers</tt> </tt>
<a name="L276"></a><tt class="py-lineno">276</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L277"></a><tt class="py-lineno">277</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">closeAllSockets</tt><tt class="py-op">:</tt> </tt>
<a name="L278"></a><tt class="py-lineno">278</tt>  <tt class="py-line">        <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt class="py-name">close_all</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L279"></a><tt class="py-lineno">279</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">stopAllPolling</tt><tt class="py-op">:</tt> </tt>
<a name="L280"></a><tt class="py-lineno">280</tt>  <tt class="py-line">        <tt class="py-keyword">global</tt> <tt id="link-70" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-70', '_pollers', 'link-41');">_pollers</a></tt> </tt>
<a name="L281"></a><tt class="py-lineno">281</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">p</tt> <tt class="py-keyword">in</tt> <tt id="link-71" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-71', '_pollers', 'link-41');">_pollers</a></tt><tt class="py-op">:</tt> </tt>
<a name="L282"></a><tt class="py-lineno">282</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L283"></a><tt class="py-lineno">283</tt>  <tt class="py-line">                <tt class="py-name">p</tt><tt class="py-op">.</tt><tt class="py-name">Stop</tt> </tt>
<a name="L284"></a><tt class="py-lineno">284</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L285"></a><tt class="py-lineno">285</tt>  <tt class="py-line">                <tt class="py-keyword">import</tt> <tt class="py-name">traceback</tt> </tt>
<a name="L286"></a><tt class="py-lineno">286</tt>  <tt class="py-line">                <tt class="py-name">traceback</tt><tt class="py-op">.</tt><tt class="py-name">print_exc</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L287"></a><tt class="py-lineno">287</tt>  <tt class="py-line"> </tt>
<a name="L288"></a><tt class="py-lineno">288</tt>  <tt class="py-line">        <tt id="link-72" class="py-name"><a title="Priithon.wxAsyncDispatcher._pollers" class="py-name" href="#" onclick="return doclink('link-72', '_pollers', 'link-41');">_pollers</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
</div><a name="L289"></a><tt class="py-lineno">289</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Priithon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/priithon">Priithon</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Nov 22 14:59:51 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
